package com.briup.app02.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.briup.app02.bean.BaseRole;
import com.briup.app02.bean.BaseRoleExample;
import com.briup.app02.dao.BaseRoleMapper;
import com.briup.app02.service.IBaseRoleService;
@Service
public class BaseRoleServiceImpl implements IBaseRoleService{
	@Autowired
	private BaseRoleMapper baserolemapper;
	@Override
	public List<BaseRole> findAll() {
		BaseRoleExample example = new BaseRoleExample();
		return baserolemapper.selectByExample(example);
	}

	@Override
	public BaseRole findById(long id) {
		return baserolemapper.selectByPrimaryKey(id);
	}

	@Override
	public void saveOrUpdate(BaseRole baserole) {
		if(baserole.getId() == null) {
			baserolemapper.insert(baserole);
		} else {
			baserolemapper.updateByPrimaryKey(baserole);
		}	
	}

	@Override
	public void deleteById(long id) {
		baserolemapper.deleteByPrimaryKey(id);
	}
}
